/**
*		@file NextBip.h
*		@brief NextBip class
*
*		@author Lan Ziquan
*
*		@date 3/3/2012
*/

#ifndef NEXTBIP_H
#define NEXTBIP_H

#include "StmtTable.h"
#include "ProcTable.h"
#include "GNode.h"
#include "Calls.h"
#include "Next.h"
#include <vector>
#include <string>
#include <sstream>
using namespace std;

class NextBip{
public:
	static void		RebuildNextBip();

	static void		CompleteNextBip();

	static bool		IsNextBip(StmtNum stmt_num_left, StmtNum stmt_num_right);
	static bool		IsNextBipAdv(StmtNum stmt_num_left, StmtNum stmt_num_right);

	static string	ToString();

private:
	static bool		ReadAndReturnNextBipAdv(StmtNum stmt_num_left, StmtNum stmt_num_right, bool& b_read_in);
	static bool		WriteAndReturnNextBipAdv(StmtNum stmt_num_left, StmtNum stmt_num_right, bool b_set_to);

	static vector<StmtSet>	next_bip_table_;
	static vector<StmtSet>	next_bip_table_t_;
	static vector<StmtSet>	next_bip_adv_table_;
	static vector<StmtSet>	next_bip_adv_cache_table_;

	static StmtSet			next_bip_has_s0_;
	static StmtSet			next_bip_has_0s_;
	static bool				next_bip_has_00_;
};

#endif